package com.zy.pro.order.service;

import com.zy.core.service.BaseService;
import com.zy.pro.letter.model.Letter;
import com.zy.pro.order.model.OrderItem;
import com.zy.pro.order.web.form.OrderItemSearchForm;

public interface OrderItemService extends BaseService<OrderItem> {
	
	/**
	 * 店铺删除订单,并发送站内信通知用户
	 * @param orderItem
	 * @param letter
	 * @throws Exception
	 */
	void updateOrderAddLetter(OrderItemSearchForm form) throws Exception;
	
	/**
	 * 用户付款,计算已付款,未付款,设置付款记录,并发送站内信通知卖家
	 * @param form
	 * @throws Exception
	 */
	void userPayment(OrderItemSearchForm form) throws Exception;
	
	/**
	 * 根据订单主键查询订单详情(包含订单付款记录)
	 * @param orderId
	 * @return
	 */
	OrderItem findOrderDetail(String orderId);
	
	/**
	 * 用户删除刚执行,并且未支付的订单,发送站内信通知卖家
	 * @param orderItem
	 * @param letter
	 * @throws Exception
	 */
	void updateOrderAndLetterShop(OrderItemSearchForm form) throws Exception;
	
	/**
	 * 用户申请退款,发送站内信 通知卖家,并且修改用户状态(1:正常,2:申请退款,3:已删除)
	 * @param form
	 * @throws Exception
	 */
	void userApplyRefund(OrderItemSearchForm form) throws Exception;
}
